<?php
    include 'rfq_check.php';
if (isset($_POST['txt_carbonContent'])) {
    include 'rfq_do.php';
    include 'common/database.php';
    include '../business/black_manager.php';
    include_once '../entity/black_entity.php';

    $blackEntity = new BlackEntity;
    $blackMng = new BlackMng();

    $blackEntity->id                    = "-1";
    $blackEntity->rfqID                 = $rfqID;
    $blackEntity->carbonContent         = $_POST['txt_carbonContent'];
    $blackEntity->particleSize          = $_POST['txt_particleSize'];
    $blackEntity->filler                = $_POST['txt_filler'];
    $blackEntity->carrier               = $_POST['txt_carrier'];
    $blackEntity->finalApp              = $_POST['txt_finalApp'];
    $blackEntity->techRequirement       = $_POST['txt_techRequirement'];
    $blackEntity->qcRequirement         = $_POST['txt_qcRequirement'];
    $blackEntity->contactRequirement    = $_POST['txt_contactRequirement'];
    $blackEntity->ploymerMFI            = $_POST['txt_ploymerMFI'];
    $blackEntity->customerResin         = $_POST['txt_customerResin'];
    $blackEntity->inTime                = time();
    $blackEntity->inUser                = $_SESSION['userID'];

    if ($blackMng->update($blackEntity)) {
        echo "<script>window.location.href='rfq_submit.php'</script>";
    }
} else {
    include 'common/smarty.php';
    $tpl->display("black.html");
}
?>
